import hashlib

def verify_model(model, expected_hash):
    """
    验证模型的完整性
    :param model: 模型参数
    :param expected_hash: 预期的哈希值
    :return: 是否通过验证
    """
    model_hash = hashlib.sha256(model).hexdigest()
    return model_hash == expected_hash

# 示例
model = b"model_weights"
expected_hash = hashlib.sha256(model).hexdigest()
is_verified = verify_model(model, expected_hash)
print(f"Is verified: {is_verified}")